!% +language_name=3English ! ============================================================================ ! ! Cloak of Darkness - a simple demonstration of Interactive Fiction ! Originally created by Roger Firth ! This version ported to Triform by Nathan Schwartzman ! ============================================================================ ! Constant Story "Cloak of Darkness"; Constant Headline "^A basic IF demonstration.^"; Constant MANUAL_PRONOUNS; Constant MAX_SCORE = 2; Include "3Parser"; Include "3VerbLib"; Attribute general; ! ============================================================================ ! Room foyer "Foyer of the Opera House" with name "foyer", description "You are standing in a spacious hall, splendidly decorated in red and gold, with glittering chandeliers overhead. The entrance from the street is to the north, and there are doorways south and west.", s_to bar, w_to cloakroom, n_to "You've only just arrived, and besides, the weather outside seems to be getting worse.", has light; Room cloakroom "Cloakroom" with name "cloakroom", description "The walls of this small room were clearly once lined with hooks, though now only one remains. The exit is a door to the east.", e_to foyer, has light; Container -> hook "small brass hook" with name 'hook' 'peg', adjective 'small' 'brass', description [; print "It's just a small brass hook, "; if (self == parent(cloak)) "with a cloak hanging on it."; "screwed to the wall."; ], ontop_capacity 1, has scenery; Room bar "Foyer bar" with name "bar", description "The bar, much rougher than you'd have guessed after the opulence of the foyer to the north, is completely empty. There seems to be some sort of message scrawled in the sawdust on the floor.", n_to foyer, before [; Go: if (self hasnt light && noun ~= n_obj) { message.number = message.number + 2; "Blundering around in the dark isn't a good idea!"; } default: if (self hasnt light) { message.number = message.number + 1; "In the dark? You could easily disturb something!"; } ], has ~light; Thing -> message "scrawled message" with name 'message' 'sawdust' 'floor', description [; if (self.number < 2) { score++; gameover = 2; print "The message, neatly marked in the sawdust, reads..."; } else { gameover = 3; print "The message has been carelessly trampled, making it difficult to read. You can just distinguish the words..."; } ], number 0, before [; Read: <>; ], has scenery; Thing cloak "velvet cloak" with name 'cloak', adjective 'handsome' 'dark' 'black' 'velvet' 'satin', description "A handsome cloak, of velvet trimmed with satin, and slightly spattered with raindrops. Its blackness is so deep that it almost seems to suck light from the room.", before [; Drop, PutOn: if (player.location == cloakroom) { give bar light; if (action == ##PutOn && self has general) { give self ~general; score++; } } else "This isn't the best place to leave a smart cloak lying around."; ], after [; Take: give bar ~light; ], has general clothing worn; [ Initialise; player.location = foyer; Move(cloak, player); "^^Hurrying through the rainswept November night, you're glad to see the bright lights of the Opera House. It's surprising that there aren't more people about but, hey, what do you expect in a cheap demo game...?^^"; ]; [ DeathMessage; print "You have lost"; ]; ! ============================================================================ ! Include "3Grammar"; Verb 'hang' * held 'on' noun -> PutOn; ! ============================================================================ !